<?php 
session_start();
include "includes/comunes.php";
    $tabla="postulantes";
    $condicion="pos_email='".trim($_POST['mail'])."' and pos_contrasena='".$_POST['pasw']."'";
    $orden="";
    $result=cons_sql($tabla, $condicion, $orden);
	//echo mysql_num_rows($result);
     if(mysql_num_rows($result)>0){
        $reg=mysql_fetch_array($result);
        $usu=explode('@', $_POST['mail']);
        $_SESSION['usuario']=$usu[0];
		 $_SESSION['nom']=utf8_encode($reg['pos_nombre']).' '.utf8_encode($reg['pos_apellido']);
        $_SESSION['id']=$reg['pos_id'];
        $_SESSION['email']=$reg['pos_email'];
		echo '<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=index.php"> ';}
	   //header("Location: index.php");}
	  else{
	   echo '<META HTTP-EQUIV="REFRESH" CONTENT="0;URL=registro.php?mail='.trim($_POST['mail']).'"> ';
	   
	  }	
?>